﻿@model Domain.Entities.Produce

@{
    ViewBag.Title = "Новый товар";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Новый товар</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Товар</legend>

         <div class="editor-label">
            Название
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            Описание
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.About, new { rows = "6", cols = "60" })
            @Html.ValidationMessageFor(model => model.About)
        </div>

        <div class="editor-label">
            Категория
        </div>
        <div class="editor-field">
            @Html.DropDownList("CategoryId")
            @Html.ValidationMessageFor(model => model.CategoryId)
        </div>

        <div class="editor-label">
            Производитель
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProducerId")
            @Html.ValidationMessageFor(model => model.CategoryId)
        </div>

        <div class="editor-label">
            Изображение
        </div>

        <div class="editor-field">
            @Html.DropDownList("ProductArtUrl")
            @Html.ValidationMessageFor(model => model.ProductArtUrl)
        </div>

        <p>
            <input type="submit" value="Добавить" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("К списку товаров", "BrowseProduces")
</div>
